<%@ Page Title="" Language="C#" MasterPageFile="~/Master/List.Master" AutoEventWireup="true"
    CodeBehind="PayIns.aspx.cs" Inherits="MTC.Web.Forms.PayIns" %>
<%@ Import Namespace="MTC.Web.Forms"%>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../Controls/Menu.ascx" TagName="Menu" TagPrefix="uc1" %>
<%@ Register Src="../Controls/NavMenu.ascx" TagName="NavMenu" TagPrefix="uc3" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1.Export, Version=9.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPHeader" runat="server">
    <table width="100%">
        <tr align="right">
            <td align="right">
                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/excel.jpg" OnClick="btnExcel_Click" />&nbsp;<asp:ImageButton
                    ID="ImageButton2" runat="server" ImageUrl="~/Images/pdf.jpg" OnClick="btnPdf_Click" />&nbsp;<asp:ImageButton
                        ID="ImageButton3" runat="server" ImageUrl="~/Images/rtf.jpg" OnClick="btnRtf_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPNav" runat="server">
    <style type="text/css">
        .PopupFormContent
        {
            float: right;
            margin: 5px;
        }
        .PopupFormContent .Row
        {
            height: 25px;
        }
        .PopupFormContent .RowCommands
        {
            height: 25px;
            text-align: right;
            float: right;
        }
        .PopupFormContent .Row .labelL, .PopupFormContent .RowTall .labelL
        {
            vertical-align:top;
            width: 150px;
            font-weight: bold;
            float:left;
            margin: 5px;
        }
        .PopupFormContent .Row .labelR, .PopupFormContent .RowTall .labelR
        {
            vertical-align:top;
            width: 150px;
            font-weight: bold;
            float:right;
            margin: 5px;
        }
        
        .PopupFormContent .Row .inputL
        {
            vertical-align:top;
            float: left;
            width: 150px;
            margin: 5px;
        }
        .PopupFormContent .Row .inputR
        {
            vertical-align:top;
            float: right;
            width: 150px;
            margin: 5px;
        }

        .CheckBoxList
        {
            float: left;
            width: 490px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPMain" runat="server">
    <table width="100%">
        <tr>
            <td style="width: 598px">
                <table style="width: 99%">
                    <tr>
                        <td style="width: 156px">
                            <dxe:ASPxLabel ID="LblDateOfSchedule" runat="server" Text="Schedule Date">
                            </dxe:ASPxLabel>
                        </td>
                        <td>
                            <dxe:ASPxDateEdit ID="TxtDateofSchedule" runat="server" >
                            </dxe:ASPxDateEdit>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 156px">
                            <dxe:ASPxLabel ID="LblShift" runat="server" Text="Shift">
                            </dxe:ASPxLabel>
                        </td>
                        <td>
                            <asp:DropDownList ID="CboShift" runat="server" DataTextField="ShiftDescription" DataValueField="ShiftId">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 156px">
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
            </td>
            <td valign="top">
                <asp:Button ID="BtnSelect" runat="server" Text="Load Roster" Width="100%" OnClick="BtnSelect_Click" />
                <br />
                <br />
            </td>
        </tr>
    </table>
    <dxwgv:ASPxGridView ID="grdPayIns" runat="server" Width="800px" AutoGenerateColumns="False"
        DataSourceID="objPayIns" KeyFieldName="ScheduleDriverTaxiId" CssFilePath="~/App_Themes/Soft Orange/{0}/styles.css"
        CssPostfix="Soft_Orange" OnRowUpdating="grdPayIns_RowUpdating" 
        onstartrowediting="grdPayIns_StartRowEditing" 
        onrowupdated="grdPayIns_RowUpdated" OnRowInserting="UsersGridRowInserting"
            OnCustomErrorText="UsersGridCustomErrorText" OnHtmlEditFormCreated="UsersGridHtmlEditFormCreated">
        <Styles CssFilePath="~/App_Themes/Soft Orange/{0}/styles.css" CssPostfix="Soft_Orange"
            GroupButtonWidth="28">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
            <LoadingPanel ImageSpacing="10px">
            </LoadingPanel>
        </Styles>
        <SettingsEditing Mode="PopupEditForm" PopupEditFormModal="true" PopupEditFormWidth="660px" PopupEditFormHorizontalAlign="WindowCenter"
            PopupEditFormHeight="350px" EditFormColumnCount="2"  PopupEditFormVerticalAlign="WindowCenter" />
        <Settings UseFixedTableLayout="True"  ShowFilterRowMenu="false" ShowFilterRow="True" ShowGroupPanel="True"  />
        <SettingsPager AlwaysShowPager="true" />        
        <Templates>
            <EditForm>
                <div class="PopupFormContent">
                        <div class="Row">
                            <label class="labelL">Schedule Date</label>
                            <label class="inputL">
                                <%# Eval("ScheduleDate","{0:d}")%></label>
                            <label class="labelL">
                                Shift</label>
                            <label class="inputL">
                                <%# Eval("ShiftDescription")%></label>
                        </div>
                        <div class="Row">
                            <label class="labelL">
                                Taxi</label>
                            <label class="inputL">
                                <%# Eval("Platenumber")%></label>
                        </div>
                        <div class="Row">
                            <label class="labelL">
                                Driver Name</label>
                            <label class="inputL">
                                <%# Eval("driverName")%></label>
                            <label class="labelL">
                                Owner Name</label>
                            <label class="inputL">
                                <%# Eval("ownerName")%></label>
                        </div>
                        <div class="Row">
                            <label class="labelL">
                                Pay In due</label>
                            <label class="inputL">
                                <%# Eval("PayInDue")%></label>
                        </div>
                       <div class="Row">
                            <label class="labelL">Pay In Date</label>
                            <dxe:ASPxDateEdit runat="server" ID="txtPayInDate" EditFormat="Custom" UseMaskBehavior="true" 
                                CssClass="inputL" />                            
                        </div><div style="clear:both"/>
                        <div class="Row">
                            <label class="labelL">Cash</label>
                            <dxe:ASPxTextBox runat="server" ID="txtCash" Text='<%# Bind("Cash")%>'
                                CssClass="inputL" />
                            <label class="labelL">M7</label>
                            <dxe:ASPxTextBox runat="server" ID="txtM7" Text='<%# Bind("M7")%>'
                                CssClass="inputL" />                            
                        </div>
                        <div class="Row">
                            <label class="labelL">EftPos</label>
                            <dxe:ASPxTextBox runat="server" ID="txtEftPos" Text='<%# Bind("EftPos")%>'
                                CssClass="inputL" />
                            <label class="labelL">Expenses</label>
                            <dxe:ASPxTextBox runat="server" ID="txtExpenses" Text='<%# Bind("Expenses")%>'
                                CssClass="inputL" />                            
                        </div>
                        <div class="Row">
                            <label class="labelL">Claims</label>
                            <dxe:ASPxTextBox runat="server" ID="txtClaims" Text='<%# Bind("Claims")%>'
                                CssClass="inputL" />
                            <label class="labelL">Carried Fwd PayIn</label>
                            <dxe:ASPxTextBox runat="server" ID="txtCarriedFwdPayIn" Text='<%# Bind("CarriedFwdPayIn")%>'
                                CssClass="inputL" />                            
                        </div>
                        <div class="Row">
                            <label class="labelL">Comment</label>
                            <dxe:ASPxTextBox runat="server" ID="txtComments" Text='<%# Bind("Comment")%>'
                                CssClass="inputL" Width="500px" 3/>
                        </div>                        
                    <div class="RowCommands">
                        <dxwgv:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton"
                            runat="server">
                        </dxwgv:ASPxGridViewTemplateReplacement>
                        <dxwgv:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton"
                            runat="server">
                        </dxwgv:ASPxGridViewTemplateReplacement>
                    </div>
                </div>
            </EditForm>
        </Templates>
        <SettingsLoadingPanel Text="" />
        <Images ImageFolder="~/App_Themes/Soft Orange/{0}/">
            <CollapsedButton Height="14px" Url="~/App_Themes/Soft Orange/GridView/gvCollapsedButton.png"
                Width="13px" />
            <ExpandedButton Height="13px" Url="~/App_Themes/Soft Orange/GridView/gvExpandedButton.png"
                Width="13px" />
            <DetailCollapsedButton Height="14px" Url="~/App_Themes/Soft Orange/GridView/gvCollapsedButton.png"
                Width="13px" />
            <DetailExpandedButton Height="13px" Url="~/App_Themes/Soft Orange/GridView/gvExpandedButton.png"
                Width="13px" />
            <HeaderFilter Height="19px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderFilter.png"
                Width="19px" />
            <HeaderActiveFilter Height="19px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderFilterActive.png"
                Width="19px" />
            <HeaderSortDown Height="3px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderSortDown.png"
                Width="6px" />
            <HeaderSortUp Height="3px" Url="~/App_Themes/Soft Orange/GridView/gvHeaderSortUp.png"
                Width="6px" />
            <FilterRowButton Height="13px" Width="13px" />
            <CustomizationWindowClose Height="18px" Width="18px" />
            <PopupEditFormWindowClose Height="18px" Width="18px" />
            <WindowResizer Height="12px" Url="~/App_Themes/Soft Orange/GridView/WindowResizer.png"
                Width="12px" />
            <FilterBuilderClose Height="18px" Width="18px" />
        </Images>
        <SettingsPager PageSize="50">
            <AllButton>
                <Image Height="19px" Width="28px" />
            </AllButton>
            <FirstPageButton>
                <Image Height="19px" Width="23px" />
            </FirstPageButton>
            <LastPageButton>
                <Image Height="19px" Width="23px" />
            </LastPageButton>
            <NextPageButton>
                <Image Height="19px" Width="19px" />
            </NextPageButton>
            <PrevPageButton>
                <Image Height="19px" Width="19px" />
            </PrevPageButton>
        </SettingsPager>
        <Columns>
            <dxwgv:GridViewCommandColumn VisibleIndex="0">
                <EditButton Visible="True">
                </EditButton>
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dxwgv:GridViewCommandColumn>
            <dxwgv:GridViewDataTextColumn FieldName="ScheduleId" VisibleIndex="1" Visible="False">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="ShiftId" Caption="Shift" VisibleIndex="2"
                ReadOnly="true">
                <DataItemTemplate>
                    <%# Eval("ShiftDescription")%>
                </DataItemTemplate>
                <EditItemTemplate>
                    <%# Eval("ShiftDescription")%>
                </EditItemTemplate>
                <EditCellStyle BackColor="#FF9900">
                </EditCellStyle>
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataDateColumn FieldName="ScheduleDate" VisibleIndex="1" Visible="False">
                <PropertiesDateEdit DisplayFormatString="{0:d}">
                </PropertiesDateEdit>            
            </dxwgv:GridViewDataDateColumn>
            <dxwgv:GridViewDataTextColumn FieldName="PlateId" VisibleIndex="1" ReadOnly="true"
                Visible="false">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataComboBoxColumn Caption="Name" FieldName="DriverId" VisibleIndex="2"
                ReadOnly="true">
                <DataItemTemplate>
                    <%# Eval("driverName")%>
                </DataItemTemplate>
            </dxwgv:GridViewDataComboBoxColumn>
            <dxwgv:GridViewDataTextColumn FieldName="TaxiId" VisibleIndex="1">
                <EditCellStyle BackColor="#FF9900">
                </EditCellStyle>
                <DataItemTemplate>
                    <%# Eval("Platenumber")%>
                </DataItemTemplate>
                <EditItemTemplate>
                    <%# Eval("Platenumber")%>
                </EditItemTemplate>
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="ShiftDescription" VisibleIndex="2" ReadOnly="true"
                Visible="false">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="FirstName" VisibleIndex="3" Visible="False">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="LastName" VisibleIndex="3" Visible="False">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="ScheduleDriverTaxiId" VisibleIndex="5" Visible="False">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="PayInDue" VisibleIndex="4" Caption="Pay In<BR/>Amount">
               <DataItemTemplate>
                    <%# String.Format("{0:0.00}",Eval("PayInDue"))%>
                </DataItemTemplate>            
            </dxwgv:GridViewDataTextColumn>            
            <dxwgv:GridViewDataDateColumn FieldName="PayInDate" VisibleIndex="5" Caption="Pay In<BR/>Date"  Width="60px">
                <PropertiesDateEdit DisplayFormatString="{0:d}">
                </PropertiesDateEdit>            
            </dxwgv:GridViewDataDateColumn>
            <dxwgv:GridViewDataTextColumn FieldName="CarriedFwdPayIn" VisibleIndex="6" Caption="Carried<BR/>Forward">
               <DataItemTemplate>
                    <%# String.Format("{0:0.00}",Eval("CarriedFwdPayIn"))%>
                </DataItemTemplate>            
            </dxwgv:GridViewDataTextColumn>
            
            <dxwgv:GridViewDataTextColumn FieldName="Cash" VisibleIndex="7">
               <DataItemTemplate>
                    <%# String.Format("{0:0.00}",Eval("Cash"))%>
                </DataItemTemplate>            
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="M7" VisibleIndex="8">
               <DataItemTemplate>
                    <%# String.Format("{0:0.00}",Eval("M7"))%>
                </DataItemTemplate>            
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="EftPos" VisibleIndex="9">
               <DataItemTemplate>
                    <%# String.Format("{0:0.00}",Eval("Eftpos"))%>
                </DataItemTemplate>            
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="Expenses" VisibleIndex="10">
               <DataItemTemplate>
                    <%# String.Format("{0:0.00}",Eval("Expenses"))%>
                </DataItemTemplate>                        
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="Claims" VisibleIndex="11">
               <DataItemTemplate>
                    <%# String.Format("{0:0.00}",Eval("Claims"))%>
                </DataItemTemplate>            
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="Comment" VisibleIndex="12" Visible="false">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="OwnerCompany" VisibleIndex="13" Visible="false">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="OwnerFirstName" VisibleIndex="14" Visible="false">
            </dxwgv:GridViewDataTextColumn>
            <dxwgv:GridViewDataTextColumn FieldName="OwnerLastName" VisibleIndex="15" Visible="false">
            </dxwgv:GridViewDataTextColumn>
        </Columns>
        <Paddings Padding="1px" />
        <ImagesEditors>
            <CalendarPrevYear Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarPrevYear.png"
                Width="23px" />
            <CalendarPrevMonth Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarPrevMonth.png"
                Width="19px" />
            <CalendarNextMonth Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarNextMonth.png"
                Width="19px" />
            <CalendarNextYear Height="19px" Url="~/App_Themes/Soft Orange/Editors/edtCalendarNextYear.png"
                Width="23px" />
        </ImagesEditors>
    </dxwgv:ASPxGridView>
    <dxwgv:ASPxGridViewExporter ID="GrdExport" runat="server" GridViewID="grdPayIns">
    </dxwgv:ASPxGridViewExporter>
    <asp:ObjectDataSource ID="objPayIns" runat="server" SelectMethod="GetASchedule" TypeName="MTC.Web.Business.PayIns"
        UpdateMethod="UpdateAPayIn" DataObjectTypeName="MTC.Web.Business.DTO.PayInScheduleEntity">
        <SelectParameters>
            <asp:ControlParameter ControlID="TxtDateofSchedule" Name="scheduleDate" PropertyName="Text"
                Type="DateTime" />
            <asp:ControlParameter ControlID="CboShift" Name="shiftId" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="CPSideBar" runat="server">
    <uc3:NavMenu ID="NavMenu1" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="CPFooter" runat="server">
</asp:Content>
